wayland: fix crash in gdk_window_wayland_get_root_coords().
authorChristian Hergert <christian@hergert.me>
Fri, 30 Aug 2013 07:23:56 +0000 (00:23 -0700)
committerChristian Hergert <christian@hergert.me>
Fri, 30 Aug 2013 07:39:18 +0000 (00:39 -0700)
Both root_x and root_y may be NULL, so check first before setting.

gdk/wayland/gdkwindow-wayland.c

index d2d0b644f5d07e6f15ef5107f5a3769873263597..52b6136ea654d5ca72d7ca6db674a2f60d0b8193 100644 (file)
@@ -1269,8 +1269,11 @@ gdk_window_wayland_get_root_coords (GdkWindow *window,
 
   _gdk_wayland_window_offset (window, &x_offset, &y_offset);
 
-  *root_x = x_offset + x;
-  *root_y = y_offset + y;
+  if (root_x)
+    *root_x = x_offset + x;
+
+  if (root_y)
+    *root_y = y_offset + y;
 
   return 1;
 }